<?php ?>
<div class="col-md-12">
	<div class="row">
		<?php include("global-includes/breadcrumbs.php"); ?>
		<div class="col-md-4 col-sm-4">
			<legend><?php echo translate("new_client_or_guest"); ?></legend>
			<?php echo $page["description"]; ?>
			
			<a href="<?php echo $site_pages["account"]["url"];?>" class="btn btn-default btn-md btn-success pull-right"><?php echo translate("new_account"); ?></a>
			<div class="clearfix"></div>
		</div>
		<div class="col-md-4 col-sm-4">
			<legend><?php echo translate("already_have_account"); ?></legend>
			
			<form role="form" class="form-horizontal" method="post" id="loginForm">
			  	<div class="form-group">
			  		<div class="col-sm-12">
      					<input type="email" class="form-control" id="email" name="email" placeholder="<?php echo translate("email"); ?>" />
    				</div>
			  	</div>
			  	<div class="form-group">
			  		<div class="col-sm-12">
			  			<input type="password" class="form-control" id="password" name="password" placeholder="<?php echo translate("password"); ?>" />
    				</div>
			  	</div>
			  	<button type="button" class="btn btn-default btn-md btn-success pull-right"><?php echo translate("submit"); ?></button>
		  	</form>
		  	<div class="clearfix"></div>
		  	<div class="col-md-8 center-block">
			  	<div class="center-block">
					<?php
						//require_once("libs/vendor/facebook/Facebook.php"); 
						//$facebook = getFacebook();
						
						/*$params = array(
							  "scope" => 'email, user_about_me, user_location',
							  "redirect_uri" => site_url()."end_fb_login.php"
							); 
						$fbLoginURL = $facebook->getLoginUrl($params);*/
						
						
						require_once ('libs/vendor/google-api-php-client/src/Google_Client.php');
						require_once ('libs/vendor/google-api-php-client/src/contrib/Google_Oauth2Service.php');
						
						$client = new Google_Client();
						$client->setApplicationName('NeoFlux Google+ Login');
						// Visit https://code.google.com/apis/console?api=plus to generate your
						// client id, client secret, and to register your redirect uri.
						$client->setClientId('257113337953.apps.googleusercontent.com');
						$client->setClientSecret('T0Cc7NhFMtNM4gL_FP61kYb7');
						$client->setRedirectUri(scripts_url().'end_google_plus_login.php');
						$client->setDeveloperKey('AIzaSyDcWwB1TNt8hnRtLyTg0cj6fkQ9wp1ivOQ');
						
						$client->setScopes(array('https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile'));

						$googleLoginUrl = $client->createAuthUrl();
						
						require_once('libs/vendor/twitteroauth/twitteroauth.php');
						require_once('libs/vendor/twitteroauth/config.php');
						
						/* Build TwitterOAuth object with client credentials. */
						$twitterConnection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
						 
						/* Get temporary credentials. */
						$request_token = $twitterConnection->getRequestToken(OAUTH_CALLBACK);
					
						/* Save temporary credentials to session. */
						$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];
						$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
						 
						/* If last connection failed don't display authorization link. */
						switch ($twitterConnection->http_code) {
						  case 200:
							/* Build authorize URL and redirect user to Twitter. */
							$twitterLoginUrl = $twitterConnection->getAuthorizeURL($token);
							
							break;
						  default:
							/* Show notification if something went wrong. */
							echo 'Could not connect to Twitter. Refresh the page or try again later.';
						}
						
					?>
				  	<!--<a href="<?php // echo $fbLoginURL; ?>" class="btn btn-default facebookLogin"><span>Facebook</span></a>-->
				  	<a href="<?php echo $googleLoginUrl; ?>" class="btn btn-default googleLogin">Google+</a>
				  	<a href="<?php echo $twitterLoginUrl; ?>" class="btn btn-default twitterLogin">Twitter</a>
			  	</div>
		  	</div>
		  	<div class="clearfix"></div>
			
		</div>
		<div class="col-md-4 col-sm-4">
			<legend><?php echo translate("need_help"); ?></legend>
			<ul class="side-nav">
				<li>
					<a href="<?php echo $site_pages["contact"]["url"];?>" 
						title="<?php echo $site_pages["contact"]["name"];?>">
							<?php echo $site_pages["contact"]["name"];?>
					</a>
				</li>
				<li>
					<a href="<?php echo $site_pages["faq"]["url"];?>" 
						title="<?php echo $site_pages["faq"]["name"];?>">
							<?php echo $site_pages["faq"]["name"];?>
					</a>
				</li>
				<li><a id="forgotPassword" href="JavaScript:void(0);"><?php echo translate("forgot_password"); ?></a></li>
			</ul>
			<div class="clearfix"></div>
		</div>
	</div>
</div>

